package com.capgemini.teamtwo.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.capgemini.teamtwo.common.ResponseBean;
import com.capgemini.teamtwo.entity.ProjectSchedule;
import com.capgemini.teamtwo.mapper.ProjectScheduleMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * ClassName:BiaoController <br/>
 * Description:todo <br/>
 * Date:2022/8/28 13:18 <br/>
 *
 * @author 于鸿飞
 */
@Api("返回表单")
@RestController
@RequestMapping("/biao")
public class BiaoController {

    @Resource
    ProjectScheduleMapper projectScheduleMapper;

    @ApiOperation("根据id获取项目进度信息")
    @GetMapping("/get/{projectid}")
    public ResponseBean<ProjectSchedule> get(@PathVariable("projectid") Integer projectid) {
        //HttpServletRequest request,@RequestBody
        LambdaQueryWrapper<ProjectSchedule> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<ProjectSchedule> eq = lambdaQueryWrapper.eq(ProjectSchedule::getProjectId, projectid);
        List<ProjectSchedule> users1 = projectScheduleMapper.selectList(eq);
        return ResponseBean.success(users1);

    }
}